export default class Route {
    constructor(routeConfig) {
        this.name = routeConfig.hash
        this.htmlName = routeConfig.tamplateUrl
        this.default = routeConfig.default || false
        this.childRoute = routeConfig.childRoute || []
        this.init()
    }
    isActiveRoute(hashPath) {
        return hashPath.replace('#', '') === this.name
    }
    init() {
        if (this.childRoute.length !== 0) {
            this.childRoute = this.childRoute.map(childRoute => new Route(childRoute))
        }
    }
}